<script setup>
import child from "./components/child.vue"
import { provide, ref, reactive } from "vue";
let data = reactive({
    userName: "张三",
    age: 19,
    istrue: false
})
provide('userName', data)
const btn = () => {
    data.istrue = !data.istrue
}
</script>


<template>
    <a-button @click="btn">点击</a-button>
    <child v-if="data.istrue" />
</template>